import java.util.Scanner;

public class Day4 {

    //1.斐波那契数列
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int a=0;
            int b=1;
            int c=0;
            while(c < n) {
                c=a+b;
                a=b;
                b=c;
            }
            System.out.println(Math.min(Math.abs(c-n),Math.abs(a-n)));
        }
    }
    //2.单词搜索
    int[] dx = {0,0,1,-1};
    int[] dy = {-1,1,0,0};
    boolean[][] check;
    String s;
    int m,n;
    public boolean exist (String[] board, String word) {
        // write code here
        m=board.length;
        n=board[0].length();
        check = new boolean[m][n];
        s = word;
        for(int i=0;i<m;i++) {
            for(int j=0;j<n;j++) {
                if(board[i].charAt(j)==s.charAt(0)) {
                    boolean bool = floodfill(board,i,j,0);
                    if(bool) return true;
                    else check[i][j]=false;
                }
            }
        }
        return false;
    }
    public boolean floodfill(String[] board,int i,int j,int k) {
        if(k==s.length()-1) return true;
        check[i][j]=true;
        for(int x=0;x<4;x++) {
            if(0<=i+dx[x]&&i+dx[x]<m&&j+dy[x]>=0&&j+dy[x]<n&&!check[i+dx[x]][j+dy[x]]&&s.charAt(k+1)==board[i+dx[x]].charAt(j+dy[x])) {
                boolean bool = floodfill(board,i+dx[x],j+dy[x],k+1);
                if(bool) return true;
                else check[i+dx[x]][j+dy[x]]=false;
            }
        }
        return false;
    }


    //3.杨辉三角
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int[][] arr = new int[n][n];
            for(int i=0;i<n;i++) {
                for(int j=0;j<=i;j++) {
                    if(j==0||i==j) arr[i][j]=1;
                    else arr[i][j] = arr[i-1][j]+arr[i-1][j-1];
                }
            }
            for(int i=0;i<n;i++) {
                for(int j=0;j<=i;j++) {
                    System.out.printf("%5d",arr[i][j]);
                }
                System.out.println();
            }

        }
    }
}
